<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>涛宝商城-商品详情</title>
		<link rel="stylesheet" type="text/css" th:href="@{appstyle/css/mdui.css}"/>
		
		
		<link rel="stylesheet" type="text/css" th:href="@{appstyle/css/detail.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{appstyle/css/common.css}"/>
		<script th:src="@{appstyle/js/jquery-3.3.1.js}" type="text/javascript" charset="utf-8"></script>
		
		
		<script th:src="@{appstyle/js/common.js}" type="text/javascript" charset="utf-8"></script>
		<script th:src="@{appstyle/js/mdui.js}" type="text/javascript" charset="utf-8"></script>
		<script th:src="@{appstyle/js/detail.js}" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
		min-width: 1080px;
		    background-color: #f6f6f6;
	}
		#header {
	height: 68px;
	border: 1px solid #66CCFF;
	background-color: #66CCFF;
}

.login {
	background-color: darkgray;
	padding-bottom: 5px;
	padding-top: 3px;
	background-color: #EEEEEE;
}

.login_1 {
	width: 1080px;
	position: relative;
	border: 1px solid #EEEEEE;
	margin: 0 auto;
}

.span1 {
	cursor: pointer;
	font-size: 12px;
	color: #999;
	text-decoration: none;
}

.ul1 {
	overflow: hidden;
}

.span {
	position: absolute;
	left: 0;
}

.span1:hover {
	color: #66CCFF;
}

li {
	list-style: none;
}

.li1 {
	float: left;
	/*display: flex;*/
	/*justify-content: center;*/
	position: relative;
	left: 74%;
	margin-left: 15px;
}

a {
	font-size: 12px;
	color: #999;
}

.a1 {
	text-decoration: none;
}

.a1:hover {
	color: #66CCFF;
}

.p1 {
	text-align: center;
	margin-top: 20px;
	color: white;
	font-size: 20px;
	font-weight: bold;
}

#body {
	width: 1080px;
	height: 111px;
	margin: 0 auto;
	position: relative;
}
*{
	margin: 0;
	padding: 0;
}
.logo {	
	width: 150px;
	font-size: 35px;
	font-weight: bold;
	display: block;
	color: #66CCFF;
	text-decoration: none;
	position: absolute;
	left: 60px;
	top: 35px;
}

.textinput {
	width: 550px;
	padding: 10px;
	border: 2px solid #66CCFF;
	font-size: 15px;
	outline: none;
}

.button1 {
	width: 80px;
	height: 42px;
	border: none;
	background-color: #66CCFF;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	outline: none;
	position: relative;
	right: 5px;
	top: 1px;
	text-align: center;
}

#body-1 {
	position: absolute;
	right: 171px;
	top: 36px;
}
hr{
	border-top: 2px solid #66CCFF;
}
#daohanglan{
position: relative;
background-color: #EEEEEE;
margin-bottom: 10px;
}
.daohanglan_1{
		    width: 1080px;
margin: 0 auto;
display: block;
}
.a3{
	    color: #888;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 50px;
}
.a3:hover{
	color: #66CCFF;
}
.fuhao{
	 color: #888;
}
#shopcar{
	    width: 1080px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border: 1px solid #66CCFF;
}
table{
	    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ebebeb;
    /*margin-bottom: 10px;*/
}
#toubu{
	    background-color: #eee;
}
tr{
	font-size: 12px;
}
.th1{
	    width: 130px;
	    text-align: left;
	        padding-left: 20px;
}
.th2{
	    width: 400px;
	    text-align: left;
}
.th3{
	    width: 100px;
    text-align: center;	
}
.th4{
	    width: 200px;
    text-align: center;
}
.th5{
	width: 100px;
    text-align: center;
}
.th6{
	    width: 110px;
    text-align: center;
}
	</style>
	<body>
		<div id="header">
			<p class="p1">涛宝商城,只有想不到,没有买不到!!!</p>
		</div>
		<div id="header_1">
			<div class="login">
				<div class="login_1">
				<span class="span"> <a href="../Land.html"
					th:if="${session.currentUser==null}">登录</a>
					<div class="mdui-container"
						style="display: inline-block; position: absolute; top: -5px"
						th:if="${session.currentUser!=null}">
						<div class="mdui-chip">
							<img class="mdui-chip-icon"
								th:src="@{${session?.currentUser?.headpic}}" /> <span
								class="mdui-chip-title"
								th:text="${session?.currentUser?.username}"></span> <span
								class="mdui-chip-title"><i
								class="mdui-icon material-icons"
								mdui-tooltip="{content: '安全退出'}" onclick="clickLogout()">&#xe5cd;</i></span>
						</div>
					</div> <a href="../register.html" th:if="${session.currentUser==null}">注册</a>
				</span>
				<ul class="ul1">
					<li class="li1"><a href="../Shopping_Cart.html" class="a1">购物车(<span
							class="number">0</span>)
					</a></li>
					<li class="li1"><a href="../orderMsg.html" class="a1">我的订单</a></li>
					<li class="li1"><a href="../userMsg.html" class="a1">我的涛宝</a></li>
					<li class="li1"><a href="../taobaostoreMsg.html" class="a1">关于涛宝</a></li>
				</ul>
			</div>
			</div>
		</div>
		<div id="body">
			<a class="logo" href="/taobaostore/index.html">涛宝商城</a>
			<div id="body-1">
				<input id="serach_Input" class="textinput" type="text" placeholder=请输入商品名称 /> <input id="serach_Btn" type="button" class="button1" value="搜索	" />
			</div>
		</div>
		<hr />
		<div id="daohanglan">
			<span class="daohanglan_1">
				<a href="index.html" class="a3">涛宝商城</a><span class="fuhao"> ></span>
				<a href="" class="a3">商品详情</a>
			</span>
		</div>
              <div class="page-container w">
              	<div class="intro-wrap clear">
              		<div class="p-img-wrap">
              			<div class="main-img-con"> <img class="main-img" th:src="${session?.front_product_msg?.data?.mainImage}">
              			</div>
              			<ul class="p-img-list">
              				<li class="p-img-item" th:each="str:${session?.front_product_msg?.data?.subImages}"> 
              				<img class="p-img" th:src="${str}" />
              				</li>
              			</ul>
              		</div>
              		<div class="p-info-wrap">
              		    <input id="product_id" type="hidden" th:value="${session?.front_product_msg?.data?.id}" />
              			<p id="product_name" class="p-name" th:text="${session?.front_product_msg?.data?.name}">商品信息主标题</p>
              			<p class="p-subtitle" th:text="${session?.front_product_msg?.data?.subtitle}">商品副标题</p>
              			<div class="info-item p-price-con"> <span class="label">价格:</span> <span class="p-price" th:text="${session?.front_product_msg?.data?.price}">￥5649</span> </div>
              			<div class="info-item p-quantity-con"> <span class="label">库存:</span> <span class="p-price" th:text="${session?.front_product_msg?.data?.stock}">997</span> </div>
              			<div class="info-item"> <span class="label">数量:</span> <input id="product_Count" class="p-count" value="1" readonly="readonly"> <span
              				id="cart_price_add" class="p-count-btn plus" data-opera-type="plus">+</span> <span id="cart_price_sub" class="p-count-btn minus" data-opera-type="minus">-</span>
              			</div>
              			<div class="info-item" id="cart-add-Btn"> <a id="cart_msg_add" class="btn cart-add">加入购物车</a> </div>
              		</div>
              	</div>
				<div class="detail-wrap">
					<div class="detail-tab-con">
						<ul class="tab-list">
							<li class="tab-item active">商品详情</li>
						</ul>
						<div th:utext="${session?.front_product_msg?.data?.detail}">
						
						</div>
						<script type="text/javascript">
		// 搜索
		$("#serach_Btn").click(function(){
			location.href="product/toSerachPage.do?keyword="+$("#serach_Input").val();
		})
		//退出
		clickLogout = function() {
			$.ajax({
				url : "user/logout.do",
				Type : "post",
				dataType : "json",
				success : function(data) {
					mdui.snackbar({
					    message: '成功安全退出!',
					    position: 'top',
					    timeout:300,
					    onClosed:function(){
					    	location.reload();
					    }
				   });
				}
			})
		}
		
		// 商品数量增加
		$("#cart_price_add").click(function(){
		    $("#product_Count").val((Number($("#product_Count").val()) + 1));
		})
		
		// 商品数量减少
		$("#cart_price_sub").click(function(){
			if($("#product_Count").val() == 0){
				alert("不能再减了!");
			}else{
			    $("#product_Count").val((Number($("#product_Count").val()) - 1));
			}
		})
		
		// 加入购物车
		$("#cart_msg_add").click(function(){
			$.ajax({
				url:"/taobaostore/cart/add.do",
				Type:"post",
				async:false,
				data:{
					productId:$("#product_id").val(),
					count:$("#product_Count").val(),
				},
				dataType:"json",
				success:function(data){
					alert(data.msg);
				}
			})
		})
	</script>
					</div>
					<div class="detail-con"> </div>
				</div>
		</div>
		<style type="text/css">
			#left li {
				margin-top: 10px;
			}

			#left li a {
				position: relative;
				left: 300px;
				color: #A9A9A9;
				font-size: 14px;
				text-decoration: none;
			}

			#left li a:hover {
				color: #66CCFF;
			}

			#rightPanel div {
				position: relative;
				left: 20px;
				margin-top: 15px;
				font-size: 14px;
				color: #666666;
			}
		</style>
	</body>
</html>
